package com.superiron.scaffold.api;

import com.superiron.scaffold.core.api.CommonResult;
import com.superiron.scaffold.entity.UserEntity;
import com.superiron.scaffold.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author yzg
 * @date 2022/3/8 11:20 AM
 * 版权所有 泰山信息科技有限公司
 */
@RestController
@Api(tags = "测试接口")
@RequestMapping("test")
@Slf4j
public class AnonController {
	
	@Autowired
	private RedisTemplate redisTemplate;
	
	@Autowired
	private UserService userService;
	
	@ApiOperation("测试接口")
	@PostMapping("getDocumentUrl")
	public CommonResult<UserEntity> getDocumentUrl() {
		
		Map map = new HashMap();
		map.put("tset", "sdsfd");
		redisTemplate.opsForValue().set("testyzg", map);
		
		List<UserEntity> userEntities = userService.findAllByMobile("张三");
		
		CommonResult result = CommonResult.success(userEntities, "成功");
		return result;
	}
	
	
}
